home *** CD-ROM | disk | FTP | other *** search
/ MacFormat España 15 / macformat_15.iso / Shareware Internet / Desarrolladores / PlayerPRO 4.5.1 Dev.Kit / MADH Library 4.01 / Libraries / PPPlug.h < prev    next >
Text File  |  1995-11-02  |  6KB  |  183 lines

  1. #ifndef __PPPLUGH__
  2. #define __PPPLUGH__
  3.  
  4. #if defined(powerc) || defined (__powerc)
  5. #pragma options align=mac68k
  6. #else
  7. #if !defined(THINK_C)
  8. #pragma options align=mac68k
  9. #endif
  10. #endif
  11.  
  12.  
  13. /********************                        ***********************/
  14. //
  15. //    Player PRO 4.5x -- Plugs FILTERS Definition & Plugs DIGITAL EDITOR Definition
  16. //
  17. //    Version 3.0
  18. //
  19. //    To use with PlayerPRO & CodeWarrior ( current vers 7.1)
  20. //
  21. //    Antoine ROSSET
  22. //    16 Tranchees
  23. //    1206 GENEVA
  24. //    SWITZERLAND
  25. //    
  26. //    FAX:            (+41 22) 346 11 97
  27. //    Compuserve:        100277,164
  28. //    Internet:         rosset@dial.eunet.ch
  29. //
  30. //    *****************    FILTERS FOR SAMPLES    ***********************/
  31. //
  32. //    Your main function have to be in this form:
  33. //    OSErr main(     sData                    *theData,                    // Sample informations, see MAD.h
  34. //                    long                    SelectionStart,                // SelectionStart 
  35. //                    long                    SelectionEnd,                // SelectionEnd, your filter SHOULD apply his effect only on the selection
  36. //                    PPInfoPlug                *thePPInfoPlug)                // Some functions of PlayerPRO that you can use in your plugs
  37. //
  38. //
  39. //    *****************                        ***********************/
  40. //
  41. //    If you want to reallocate theData or theData->data:
  42. //    
  43. //    if( theData->data != 0L) DisposPtr( theData->data);        // VERY IMPORTANT to free memory
  44. //    theData->data = NewPtr( newsize);                        // Use NewPtr ONLY to allocate memory!
  45. //    
  46. //    theData->size = newsize;                                // In bytes !! Even for 16 bits !
  47. //    
  48. //    Don't forget to UPDATE the theData->size !!!!!!!!!!!!
  49. //
  50. //    *****************                        ***********************/
  51. //
  52. //    About Resources:
  53. //
  54. //    Your Plug should have: Creator: 'SNPL', Type: 'PLug'
  55. //
  56. //    Your Plug have to have these resources:
  57. //
  58. //    - One resource CODE 1000 with 68k Code  ** You should NOT use the 68881 coprocessor **
  59. //    - One resource PPCC 1000 with PPC Code  (OPTIONAL: if PlayerPRO PPC version cannot find it, it will use the CODE 1000 68k resource)
  60. //    - One STR# resource :
  61. //
  62. //        1 string: Menu Name (see Instrument window in PlayerPRO)
  63. //
  64. /********************                        ***********************/
  65.  
  66. typedef struct
  67. {
  68.     void        *RPlaySoundUPP;            //    OSErr            RPlaySound( Ptr whichSound, long SoundSize, long whichTrack, long Period, long Amplitude, long loopStart, long loopLength)
  69.     void        *UpdateALLWindowUPP;    //    void            UpdateALLWindow( void)
  70.     void        *MyDlgFilterUPP;        //    pascal Boolean    MyDlgFilter( DialogPtr theDlg, EventRecord *theEvt, short *itemHit)
  71.     
  72. } PPInfoPlug;
  73.  
  74. typedef OSErr            (*RPlaySoundUPP)        ( Ptr, long, long, long, long, long, long);
  75. typedef void            (*UpdateALLWindowUPP)    ( void);
  76. typedef pascal Boolean    (*MyDlgFilterUPP)        ( DialogPtr, EventRecord*, short*);
  77.  
  78.  
  79. #if defined(powerc) || defined(__powerc)
  80.  
  81. #include "mixedmode.h"
  82.  
  83.         /****** POWERPC calls *********/
  84.  
  85. #define         RPlaySoundCallMode (    kCStackBased|\
  86.                 RESULT_SIZE( SIZE_CODE( sizeof(OSErr) ))|\
  87.                 STACK_ROUTINE_PARAMETER( 1, SIZE_CODE( sizeof( Ptr)))|\
  88.                 STACK_ROUTINE_PARAMETER( 2, SIZE_CODE( sizeof( long)))|\
  89.                 STACK_ROUTINE_PARAMETER( 3, SIZE_CODE( sizeof( long)))|\
  90.                 STACK_ROUTINE_PARAMETER( 4, SIZE_CODE( sizeof( long)))|\
  91.                 STACK_ROUTINE_PARAMETER( 5, SIZE_CODE( sizeof( long)))|\
  92.                 STACK_ROUTINE_PARAMETER( 6, SIZE_CODE( sizeof( long)))|\
  93.                  STACK_ROUTINE_PARAMETER( 7, SIZE_CODE( sizeof( long))))
  94.  
  95. #define CallRPlaySoundUPP( v1, v2, v3, v4, v5, v6, v7)        \
  96.         CallUniversalProc( thePPInfoPlug->RPlaySoundUPP, RPlaySoundCallMode, v1, v2, v3, v4, v5, v6, v7)
  97.  
  98. /**/
  99.  
  100. #define UpdateALLWindowCallMode (    kCStackBased)
  101.  
  102. #define CallUpdateALLWindowUPP()        \
  103.         CallUniversalProc( thePPInfoPlug->UpdateALLWindowUPP, UpdateALLWindowCallMode)
  104.  
  105. /**/
  106.  
  107. #else    /******** 68K calls ***********/
  108.  
  109. #define CallRPlaySoundUPP( v1, v2, v3, v4, v5, v6, v7)        \
  110.         (* (RPlaySoundUPP) (thePPInfoPlug->RPlaySoundUPP))( v1, v2, v3, v4, v5, v6, v7)
  111.  
  112. /**/
  113.  
  114. #define CallUpdateALLWindowUPP()        \
  115.         (* (UpdateALLWindowUPP) (thePPInfoPlug->UpdateALLWindowUPP))
  116.  
  117. /**/
  118. #endif
  119.  
  120. /********************                        ***********************/
  121. //
  122. //
  123. // RPlaySoundUPP    : See Developper Toolkit documentation. Play a SoundPtr at a specific Period by using PlayerPRO Driver.
  124. // UpdateALLWindow    : Check all PlayerPRO windows and update them if need it.
  125. // MyDlgFilterUPP    : to use with a ModalDialog function: allow movable dialog, PlayerPRO windows updating, Item 1 Frame, Copy/Paste support, Key support
  126. //
  127. //
  128. /********************                        ***********************/
  129.  
  130.  
  131. /******************************************************************/
  132. //******************* DIGITAL EDITOR PLUGS  ***********************/
  133. //
  134. //    Your main function have to be in this form:
  135. //    OSErr main(     Ptr                        *Pcmd,                        // Digital Selection
  136. //                    PPInfoPlug                *thePPInfoPlug)                // Some functions of PlayerPRO that you can use in your plugs
  137. //
  138. //
  139. //    *****************                        ***********************/
  140. //
  141. //    If you want to reallocate Pcmd:
  142. //    
  143. //    if( Pcmd != 0L) DisposPtr( (Ptr) Pcmd);                            // VERY IMPORTANT
  144. //    Pcmd = NewPtrClear( sizeof( Pcmd) + noCell * sizeof( Cmd));        // Use NewPtr ONLY to allocate memory!
  145. //
  146. //    myPcmd->structSize     = sizeof( Pcmd) + noCell * sizeof( Cmd);
  147. //    
  148. //    Don't forget to UPDATE the myPcmd->structSize !!!!!!!!!!!!
  149. //
  150. //    *****************                        ***********************/
  151. //
  152. //    About Resources:
  153. //
  154. //    Your Plug should have: Creator: 'SNPL', Type: 'PPDG'
  155. //
  156. //    Your Plug have to have these resources:
  157. //
  158. //    - One resource CODE 1000 with 68k Code  ** You should NOT use the 68881 coprocessor **
  159. //    - One resource PPCC 1000 with PPC Code  (OPTIONAL: if PlayerPRO in PPC cannot find it, it will use the CODE 1000 resource)
  160. //    - One STR# resource :
  161. //
  162. //        1 string: Menu Name (see Button in Digital Editor window in PlayerPRO)
  163. //
  164. /********************                        ***********************/
  165.  
  166. typedef struct
  167. {
  168.     short            tracks;                    // number of tracks in myCmd[]
  169.     short            length;                    // number of rows in myCmd[]
  170.     short            trackStart;                // track ID of first track in myCmd[]
  171.     short            posStart;                // row ID of first row in myCmd[]
  172.     long            structSize;                // struct size in bytes - see Definition
  173.     Cmd                myCmd[];
  174. } Pcmd;
  175.  
  176. #if defined(powerc) || defined (__powerc)
  177. #pragma options align=reset
  178. #else
  179. #if !defined(THINK_C)
  180. #pragma options align=reset
  181. #endif
  182. #endif
  183. #endif